package com.example.xm.controller;

import com.example.xm.entity.DingCai;
import com.example.xm.entity.Yinyue;
import com.example.xm.mapper.DingcaiMapper;
import com.example.xm.service.IDingcaiService;
import com.example.xm.web.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/dingcai")
public class DingcaiController {
    @Autowired
    IDingcaiService dingcaiService;
    @Autowired
    DingcaiMapper dingcaiMapper;
@GetMapping("/shoucang")
    public Result shoucang(Integer uid,Integer vid,Integer type) {
    dingcaiService.shoucang(uid,vid,type);
    return Result.success();
}
    @GetMapping("/addGedan")
    public Result addGedan(Integer uid,Integer vid,Integer gid) {
        dingcaiService.addGedan(uid,vid,gid);
        return Result.success();
    }
    @GetMapping("/list")
    public Result list(Integer uid,Integer type) {
        List<Yinyue> list=dingcaiService.list(uid,type);
        return Result.success(list);
    }
}
